package module.main.view.mainInterface
{
	import code.main.utils.TextFieldUtil;
	
	import com.fminutes.vinciUI.containers.Box;
	import com.fminutes.vinciUI.containers.ContainerBase;
	import com.fminutes.vinciUI.manager.UIManager;
	
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldType;

	public class PromptInfoPanel extends ContainerBase
	{
		private var promptInfoTxt:TextField;
		private var box:Box;
		private var str:TextField;
		public function PromptInfoPanel(promptInfoStr:String)
		{
			super();
			str = new TextField();
			trace(str.height);
			str.text = "";
			promptInfoTxt = TextFieldUtil.creatNormalTextField(promptInfoStr,10,0xfffff,true,0x000000,false,"left");
			box = new Box();
			box.width = 100;
			addChild(box);
			init();
		}
		private function init():void
		{
			var j:uint = 0;
			var i:uint;
			for(i = 0;i<promptInfoTxt.width / 100;i++)
			{
				str.text = str.text + promptInfoTxt.text.substr((20 * i) + j,20) + "\n";
				j = 1;
				trace(str);
			}
			box.height = i * 15
			box.skin = creatBox();
			box.addChild(str);
		}
		private function creatBox():Sprite
		{
			var boxSkin:Sprite = new Sprite;
			boxSkin.graphics.beginFill(0xffffff);
			boxSkin.graphics.drawRoundRect(0,0,box.width,box.height,20);
			boxSkin.graphics.endFill();
			return boxSkin;
		}
	}
}